The present invention relates to a communication control method and apparatus for connecting apparatuses such as a host computer and printer.
In recent years, an IEEE1394 interface is used for connecting a computer and peripheral apparatus, or connecting peripheral apparatuses. The IEEE1394 interface allows higher-speed, two-way communications as compared to a hand-shake scheme such as a Centronics interface. Also, the IEEE1394 interface is a memory bus model interface, and equipments connected via the IEEE1394 interface can read data from the designated address of a connected equipment and can write data at the designated address.
IEEE1394 defines the protocol of the physical and link layers utilized in many applications, but does not define detailed protocols in units of equipments. For this reason, the protocol of the transport layer such as SBP (Serial Bus Protocol)-2 that uses IEEE1394 as the physical and link layers has been proposed. The transport layer provides a data transfer function to an application, and applications which use this layer can exchange data with each other.
The protocol SBP-2 utilizes the features of the memory bus model of IEEE1394, and with this protocol, the data receiving side can receive data as its resources become available.
In SBP-2, when data is to be transferred, the transmitting side performs operation called a login to establish a channel with a communication partner. In this case, the logged-in side is called an initiator, and the partner is called a target. Data transfer is done in such a manner that the target reads/write data from/to the initiator in accordance with an instruction from the initiator. In this scheme, the initiator generates an ORB (Operation Request Block) that contains the storage address, size, and the like of data to be transmitted after the login, and informs the target of the address of that ORB. The target reads out data from the initiator on the basis of the address and size written in the ORB and processes the readout data, or writes data as its resources become available. After such processing, the target generates a status block to inform the initiator of the processing state.
When a communication is made using SBP-2 built based on IEEE1394, especially when SBP-2 is applied to data transfer from a data source such as a host computer or the like, which serves as an initiator, to a peripheral apparatus such as a printer apparatus, which serves as a target, the following two problems are posed.
(1) The procedure is complex due to full-duplex communications.
In SBP-2, data transfer is basically managed by the initiator, and the target cannot asynchronously transfer data to the initiator. In SBP-2, when the target wants to transfer data to the initiator, it sends a data read request using unsolicited status to the initiator. The initiator generates an ORB in response to the request, and adds the generated ORB to the end of a list of pending ORBs (including a data transfer request from the initiator to the target, and the like). These ORBs are processed in turn from the oldest one. For this reason, only when the ORB processing of the initiator side has progressed, and the initiator processes the ORB generated in response to the data read request from the target, the target can transfer data to the initiator. That is, the data transfer timing from the target to the initiator is not the issuance timing of the read request from the target to the initiator but is delayed from that timing by the time required for processing the pending ORBs. As a result, two-way, asynchronous data transfer cannot be done. When data to be transferred from the target to the initiator is generated asynchronously, for example, when the target is a printer and an error occurs in that printer, the data to be immediately transmitted to the initiator cannot be transferred in real time.
For this reason, in order to transfer data asynchronously generated by a printer to a host in real time, the printer must undertake a login procedure as an initiator, and must perform data transfer to the host computer as a target.
In this way, when the host computer and printer log in each other, and they both serve as an initiator and target, they must both own processes as an initiator and target. The printer must also perform a login.
A peripheral apparatus such as a printer which processes an image consumes large volumes of memory and processor resources for image processing. For this reason, in order to reduce the cost by simplifying the apparatus arrangement and to attain quick processing, resources used for purposes other than image processing must be reduced as much as possible. However, when the printer must run many processes, as described above, many resources are consumed accordingly, thus disturbing a cost reduction and efficient processing.
On the other hand, data that flow between the host computer and printer are related to each other like print data and its processing status. If channels are set in two ways by independent login processes, their data and responses must be related to each other, and a new processing protocol therefor must be added.
In this way, it is inappropriate to directly apply IEEE1394 and SBP-2 to communications between the host computer and printer, and it is hard to reduce required resources in the respective apparatuses and to improve efficiency.
(2) Multi-channels cannot be realized.
Recently, a multi-functional machine that combines various functions is popularly used as a peripheral apparatus. For example, a digital multi-functional machine which allows a host computer to use it as a scanner, printer, and facsimile is known. When such apparatus is used, a plurality of functions can be simultaneously used if communications are made via a plurality of independent channels in units of functions.
However, since SBP-2 cannot provide multi-channels, it is difficult to use such unit functions simultaneously.
Some protocols other than SBP-2 can transfer asynchronously generated data and can realize multi-channels. However, such protocols cannot utilize the features of IEEE1394 as the memory bus model. That is, when such protocols are applied to communications between the host and printer, the printer cannot perform data transfer at its convenience, and the host must perform data transfer while monitoring the printer state.
The present invention has been made in consideration of the aforementioned prior art, and has as its object to provide a communication control method and apparatus, which can make full-duplex communications (asynchronous two-way communications) by a single login process, and can efficiently utilize resources such as processes, memories, and the like required for data exchange, and a printer apparatus using the method.
It is another object of the present invention to provide a communication control method and apparatus, which allows a target to read out data prepared by an initiator as soon as its resources become available, and can prevent the initiator from being occupied by data transfer on the convenience of the target, and a printer apparatus using the method.
It is still another object of the present invention to provide a communication control method and apparatus which can realize multi-channels, and a printer apparatus using the same.
In order to achieve the above object, the present invention comprises the following arrangement.
That is, there is provided a communication control method of exchanging data upon accessing a storage area of an initiator from a target,
wherein the initiator transmits commands corresponding to read and write accesses to the storage area to the target so as not to exceed the number of read and write commands that can be held by the target, and
the target holds the received read and write commands in different queues, and independently processes the held commands.
There is also provided a communication control method of exchanging data upon accessing a storage area of an initiator from a target,
wherein the target checks if a size of data to be transmitted exceeds a predetermined size, requests the initiator to issue a write command in the storage area when the size of the data to be transmitted exceeds the predetermined size, and sends the data to the initiator when the size of the data to be transmitted does not exceed the predetermined size, and
the initiator issues a write command upon receiving a write command issuance request from the target.
There is also provided a communication system for exchanging data upon accessing a storage area of an initiator from a target,
wherein the initiator transmits commands corresponding to read and write accesses to the storage area to the target so as not to exceed the number of read and write commands that can be held by the target, and
the target holds the received read and write commands in different queues, and independently processes the held commands.
There is also provided a communication system for exchanging data upon accessing a storage area of an initiator from a target,
wherein the target checks if a size of data to be transmitted exceeds a predetermined size, requests the initiator to issue a write command in the storage area when the size of the data to be transmitted exceeds the predetermined size, and sends the data to the initiator when the size of the data to be transmitted does not exceed the predetermined size, and
the initiator issues a write command upon receiving a write command issuance request from the target.
There is also provided a communication control method of exchanging data with a target upon accessing a storage area in a memory from the target connected via a communication, comprising:
the queuing step of receiving a spontaneous request from the target and queuing the request in a queue; and
the command generation step of generating and transmitting read and write commands to the storage area in response to a request from an application or the target so as not to exceed the number of read and write commands that can be held by the target.
There is also provided a communication control method of exchanging data with an initiator upon accessing a storage area of the initiator connected via a communication, comprising:
the queuing step of queuing a read command received from the initiator in a queue having a predetermined size;
the queued execution step of picking up and executing a read command from the queue;
the immediate execution step of executing a write command received from the initiator immediately after reception; and
the transfer request step of issuing a data transfer request to the initiator.
There is also provided a communication control apparatus for exchanging data with a target via a storage area, comprising:
means for communicating with a target;
a memory including the storage area;
queue management means for queuing a spontaneous request from the target; and
command generation means for generating and transmitting read and write commands with respect to the storage area in response to a request from an application or the target so as not to exceed the number of read and write commands that can be held by the target.
There is also provided a communication control apparatus for exchanging data with an initiator by accessing a storage area of the initiator, comprising:
means for communicating with the initiator;
a queue which holds a read command received from the initiator and has a predetermined size;
queued execution means for picking up and executing the read command from the queue;
immediate execution means for executing a write command received from the initiator immediately after reception; and
transfer request means for issuing a data transfer request to the initiator.
There is also provided a computer readable storage medium, which stores a communication control program for exchanging data by accessing a storage area from a target via a communication, the program comprising:
queue management means for queuing a spontaneous request from the target; and
command generation means for generating and transmitting read and write commands with respect to the storage area in response to a request from an application or the target so as not to exceed the number of read and write commands that can be held by the target.
There is also provided a computer readable storage medium, which stores a communication control program for exchanging data by accessing a storage area of an initiator connected via a communication, the program comprising:
queue management means for queuing a read command received from the initiator in a queue having a predetermined capacity;
queued execution means for picking up and executing the read command from the queue;
immediate execution means for executing a write command received from the initiator immediately after reception; and
transfer request means for issuing a data transfer request to the initiator.
There is also provided a printing system using a communication control method in which an initiator transmits commands corresponding to read and write accesses to a storage area to a target so as not to exceed the number of read and write commands that can be held by the target, and the target holds the received read and write commands in different queues, and independently processes the held commands, wherein a host apparatus serving as an initiator is connected to a printer apparatus serving as a target, the printer apparatus receives print data from the host apparatus and prints out based on the received print data, and the host apparatus receives status information of the printer apparatus.
There is also provided a printing control apparatus for transmitting print data to a target, and receiving status information from the target, in a communication control method which comprises the queuing step of receiving a spontaneous request from the target and queuing the request in a queue, and the command generation step of generating and transmitting read and write commands to the storage area in response to a request from an application or the target so as not to exceed the number of read and write commands that can be held by the target.
There is also provided a printing apparatus for receiving print data from an initiator, and transmitting status information to the initiator, by a communication control method which comprises the queuing step of queuing a read command received from the initiator in a queue having a predetermined size, the queued execution step of picking up and executing a read command from the queue, the immediate execution step of executing a write command received from the initiator immediately after reception, and the transfer request step of issuing a data transfer request to the initiator.